<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>Languages and Localization in M.U.G.E.N</title>
<style type="text/css">

/*
M.U.G.E.N documentation stylesheet.


Modified from voidspace.css.

:Authors: Ian Bicking, Michael Foord
:Contact: fuzzyman@voidspace.org.uk
:Date: 2005/08/26 
:Version: 0.1.0
:Copyright: This stylesheet has been placed in the public domain.

Stylesheet for Docutils.
Based on ``blue_box.css`` by Ian Bicking
and ``html4css1.css`` revision 1.46.
*/

@import url(html4css1.css);

body {
  font-family: Helvetica, Arial, sans-serif;
}

em, i {
  font-family: Times New Roman, Times, serif;
}

a {
  color: #5577EE;
  text-decoration: none;
}

a.reference.internal {
  font-size: 80%;
}

a.toc-backref {
  color: black;
  text-decoration: none;
}

a.toc-backref:hover {
  background-color: inherit;
}

a:hover {
  background-color: #cccccc;
  text-decoration: none;
}

a img {
  border: none;
}

div.attention, div.caution, div.danger, div.error, div.hint,
div.important, div.note, div.tip, div.warning {
  background-color: #cccccc;
  padding: 3px;
  width: 80%;
}

div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title  {
  text-align: center;
  background-color: #999999;
  display: block;
  margin: 0;
}

div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title {
  color: #cc0000;
  font-family: sans-serif;
  text-align: center;
  background-color: #999999;
  display: block;
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: Verdana, Helvetica, Arial, sans-serif;
  border: thin solid black;
  /* This makes the borders rounded on Mozilla, which pleases me */
  -moz-border-radius: 8px;
  padding: 4px;
}

h1 {
  background-color: #445BAA;
  color: #ffffff;
  border: medium solid black;
}

h1 a.toc-backref, h2 a.toc-backref { 
  color: #ffffff;
}

h2 {
  background-color: #667788;
  color: #ffffff;
  border: thin solid black;
}

h3, h4, h5, h6 {
  background-color: #cccccc;
  color: #000000;
}

h3 a.toc-backref, h4 a.toc-backref, h5 a.toc-backref, 
h6 a.toc-backref { 
  color: #000000;
}

h1.title {
  text-align: center;
  background-color: #445BAA;
  color: #eeeeee;
  border: thick solid black;
  -moz-border-radius: 20px;
}

ol.loweralpha {
  list-style: lower-alpha }

ol.upperalpha {
  list-style: upper-alpha }

ol.lowerroman {
  list-style: lower-roman }

ol.upperroman {
  list-style: upper-roman }

table.footnote {
  padding-left: 0.5ex;
}

table.citation {
  padding-left: 0.5ex
}

pre.literal-block, pre.doctest-block {
  border: thin black solid;
  padding: 5px;
}

.image img { border-style : solid;
            border-width : 2px;
}

h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
  font-size: 100%;
}

code, tt {
  color: #000066;
  font-size: 120%;
}

</style>
</head>
<body>
<div class="document" id="languages-and-localization-in-m-u-g-e-n">
<h1 class="title">Languages and Localization in M.U.G.E.N</h1>

<p>M.U.G.E.N, (c) Elecbyte 1999-2009</p>
<p>Documentation for version 1.0 (2009)</p>
<p>Updated 19 October 2009</p>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#overview" id="id1">Overview</a></li>
<li><a class="reference internal" href="#language-mechanism" id="id2">Language Mechanism</a><ul>
<li><a class="reference internal" href="#localization-notes" id="id3">Localization Notes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#groups-exempt-from-localization" id="id4">Groups Exempt From Localization</a></li>
</ul>
</div>
<div class="section" id="overview">
<h1><a class="toc-backref" href="#id1">Overview</a></h1>
<p>M.U.G.E.N is an English language program by default, but supports the capability to switch the language displayed in within the game.  In order for motifs and characters to support being properly displayed for a particular language, the appropriate language strings must be added and configured for each of those motifs and characters.  This process of configuring for a new language is called localization.</p>
<p>Examples of assets that can be localized are the victory quotes of characters, or the title logo shown in the title screen.</p>
<p>In M.U.G.E.N, the desired language is configured in mugen.cfg.  The &quot;Language&quot; setting is located in the [Config] group.  When the M.U.G.E.N runtime is started, the language setting will be loaded and used for the duration of the program.</p>
<pre class="literal-block">
[Config]
Language = &quot;en&quot;
</pre>
<p>The language parameter is an ISO 639-1 code, which is a two-letter code that corresponds to a specific language.  For example, to set your preferred language to Japanese:</p>
<pre class="literal-block">
[Config]
Language = &quot;ja&quot;
</pre>
<p>A full list of valid ISO 639-1 codes can be viewed on Wikipedia at <a class="reference external" href="http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes">http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes</a></p>
<p>All characters and motifs are required to support the English language by default.  If a particular character or motif is not configured to support the language set in mugen.cfg, that character or motif will fall back to being displayed in English.</p>
</div>
<div class="section" id="language-mechanism">
<h1><a class="toc-backref" href="#id2">Language Mechanism</a></h1>
<p>The language mechanism in M.U.G.E.N operates on the level of groups within definition files.  Groups are blocks of text beginning with a line that has a string enclosed in square brackets ('[' amd ']').  For example:</p>
<pre class="literal-block">
[Group 1]
Contents of Group 1.
Another line in Group 1.
This is the last line in Group 1.

[Group 2]
This line is in Group 2.
</pre>
<p>In order to localize a group for a target language, a copy of the group must first be made, and the target language's ISO 639-1 code followed by a period ('.') prepended to the name of the group.  Groups without the language code are known as <em>undecorated groups</em> and groups whose name is prepended with the language code are known as <em>localized groups</em>.  For example:</p>
<pre class="literal-block">
[Group A]
This is the original Group A.
This is called an undecorated group.
The target language for undecorated groups must be English.

[ja.Group A]
This is Group A localized for Japanese.
This is called a localized group that will be loaded when the
preferred language is &quot;ja&quot;.
</pre>
<p>Whenever M.U.G.E.N attempts to load a group that supports this language mechanism, the loader first scans the file for the localized group name.  If found, that group will be loaded.  If the localized group is not found, the loader then scans the file for the undecorated group name.  Following the example above, if the preferred language is configured to &quot;ja&quot;, an attempt to load [ja.Group A] will be made before attempting to load [Group A].</p>
<p>By this mechanism, only groups that need to have different contents based on the preferred language need to be localized.  Groups that do not require different contents across languages may be left undecorated.  In order to correctly display strings in undecorated groups regardless of preferred language, it is required that the language used for undecorated groups be English.</p>
<p>Certain groups cannot be localized using this mechanism.  See Section &quot;Groups Exempt From Localization&quot; for details.</p>
<div class="section" id="localization-notes">
<h2><a class="toc-backref" href="#id3">Localization Notes</a></h2>
<ul class="simple">
<li>When localizing motifs, it may be required to localize the [Files] group in system.def in order
to substitute an appropriate victory quote font for the target language.
True Type fonts are required for text that contains non-ASCII characters.</li>
<li>When localizing storyboard scenes, the undecorated portion of the localized group name must be
an exact match of its English equivalent's group name, e.g. [Scene 3 hello] would be localized in Spanish as
[es.Scene 3 hello], not [es.Scene 3 hola].</li>
<li>It is recommended (but not required) that character and stage display names are written in
English (more precisely, using the ASCII character set), in order to be displayed correctly
across different motifs, as well as to maintain a consistent look within the game.</li>
</ul>
</div>
</div>
<div class="section" id="groups-exempt-from-localization">
<h1><a class="toc-backref" href="#id4">Groups Exempt From Localization</a></h1>
<p>The following groups cannot be localized by the language mechanism described above.</p>
<ul class="simple">
<li>All groups in mugen.cfg.</li>
<li>Character command and state groups, i.e. [Command], [State ...] and [Statedef ...]</li>
<li>Individual backgrounds elements.</li>
</ul>
</div>
</div>
</body>
</html>
